package com.itany.springcloud.springcloudnacosconfig;

import com.itany.springcloud.springcloudnacosconfig.bean.SomeBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringcloudNacosConfigApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext ac=SpringApplication.run(SpringcloudNacosConfigApplication.class, args);


        SomeBean someBean= (SomeBean) ac.getBean("someBean");
        System.out.println("someBean = " + someBean);
        System.out.println("someBean.getStr() = " + someBean.getStr());
        System.out.println("someBean.getI() = " + someBean.getI());



        String str=ac.getEnvironment().getProperty("some.str");
        String i=ac.getEnvironment().getProperty("some.str");
        System.out.println("str = " + str);
        System.out.println("i = " + i);






    }

}
